package com.tedu.egmybatis1.mapper;

import com.tedu.egmybatis1.pojo.Product;
import org.apache.ibatis.annotations.*;

@Mapper
public interface ProductMapper {
    @Insert("insert into product(title,price,stock) values(#{title},#{price},#{stock})")
    int insert(Product product);
    @Delete("delete from product where id=#{id}")
    int deleteById(Integer id);
    @Select("select id,title,price,stock from product where id=#{id}")
    Product selectById(Integer id);
    @Update("update product set title=#{title},price=#{price},stock=#{stock} where id=#{id}")
    int updateById(Product product);
}
